// SampleScripts.js
//


Type.createNamespace('SampleScripts.core');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.core.TemplateScript

SampleScripts.core.TemplateScript = function SampleScripts_core_TemplateScript() {
}
SampleScripts.core.TemplateScript.main = function SampleScripts_core_TemplateScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.core.TemplateScript().init();
    }));
}
SampleScripts.core.TemplateScript.prototype = {
    _p1: null,
    _p2: null,
    
    init: function SampleScripts_core_TemplateScript$init() {
        var data = { name: 'Jack Slocum', company: 'Ext JS, LLC', address: '4 Red Bulls Drive', city: 'Cleveland', state: 'Ohio', zip: '44102', kids: [ { name: 'Sara Grace', age: 3 }, { name: 'Zachary', age: 2 }, { name: 'John James', age: 0 } ] };
        this._p1 = new Ext.Panel(new Ext.PanelConfig().title('Basic Template').width(300).html('<p><i>Apply the template to see results here</i></p>').tbar([ new Ext.Toolbar.ButtonConfig().text('Apply Template').handler(Delegate.create(this, function() {
            var tpl = new Ext.Template('<p>Name: {name}</p>\r\n\t\t\t\t\t\t\t\t\t\t\t<p>Company: {company}</p>\r\n\t\t\t\t\t\t\t\t\t\t\t<p>Location: {city}, {state}</p>');
            var body = this._p1.body;
            tpl.overwrite(body, data);
            body.highlight('#c3daf9', { block: true });
        })).toDictionary() ]).renderTo(document.body).toDictionary());
        this._p2 = new Ext.Panel(new Ext.PanelConfig().title('XTemplate').width(300).html('<p><i>Apply the template to see results here</i></p>').tbar([ new Ext.Toolbar.ButtonConfig().text('Apply Template').handler(Delegate.create(this, function() {
            var tpl = new Ext.XTemplate('<p>Name: {name}</p>\r\n\t\t\t\t\t\t\t\t\t\t\t<p>Company: {company}</p>\r\n\t\t\t\t\t\t\t\t\t\t\t<p>Location: {city}, {state}</p>\r\n\t\t\t\t\t\t\t\t\t\t\t<p>Kids: \r\n\t\t\t\t\t\t\t\t\t\t\t<tpl for=\"kids\" if=\"name==\'Jack Slocum\'\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<tpl if=\"age &gt; 1\"><p>{#}. {parent.name}\'s kid - {name}</p></tpl>\r\n\t\t\t\t\t\t\t\t\t\t\t</tpl></p>');
            var body = this._p2.body;
            tpl.overwrite(body, data);
            body.highlight('#c3daf9', { block: true });
        })).toDictionary() ]).renderTo(document.body).toDictionary());
    }
}


Type.createNamespace('SampleScripts.menu');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.menu.State

SampleScripts.menu.State = function SampleScripts_menu_State(_abbr, _state) {
    this.abbr = _abbr;
    this.state = _state;
}
SampleScripts.menu.State.prototype = {
    abbr: null,
    state: null
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.menu.ComboScript

SampleScripts.menu.ComboScript = function SampleScripts_menu_ComboScript() {
    this._states = [ [ 'AL', 'Alabama' ], [ 'AK', 'Alaska' ], [ 'AZ', 'Arizona' ], [ 'AR', 'Arkansas' ], [ 'CA', 'California' ], [ 'CO', 'Colorado' ], [ 'CT', 'Connecticut' ], [ 'DE', 'Delaware' ], [ 'DC', 'District of Columbia' ], [ 'FL', 'Florida' ], [ 'GA', 'Georgia' ], [ 'HI', 'Hawaii' ], [ 'ID', 'Idaho' ], [ 'IL', 'Illinois' ], [ 'IN', 'Indiana' ], [ 'IA', 'Iowa' ], [ 'KS', 'Kansas' ], [ 'KY', 'Kentucky' ], [ 'LA', 'Louisiana' ], [ 'ME', 'Maine' ], [ 'MD', 'Maryland' ], [ 'MA', 'Massachusetts' ], [ 'MI', 'Michigan' ], [ 'MN', 'Minnesota' ], [ 'MS', 'Mississippi' ], [ 'MO', 'Missouri' ], [ 'MT', 'Montana' ], [ 'NE', 'Nebraska' ], [ 'NV', 'Nevada' ], [ 'NH', 'New Hampshire' ], [ 'NJ', 'New Jersey' ], [ 'NM', 'New Mexico' ], [ 'NY', 'New York' ], [ 'NC', 'North Carolina' ], [ 'ND', 'North Dakota' ], [ 'OH', 'Ohio' ], [ 'OK', 'Oklahoma' ], [ 'OR', 'Oregon' ], [ 'PA', 'Pennsylvania' ], [ 'RI', 'Rhode Island' ], [ 'SC', 'South Carolina' ], [ 'SD', 'South Dakota' ], [ 'TN', 'Tennessee' ], [ 'TX', 'Texas' ], [ 'UT', 'Utah' ], [ 'VT', 'Vermont' ], [ 'VA', 'Virginia' ], [ 'WA', 'Washington' ], [ 'WV', 'West Virginia' ], [ 'WI', 'Wisconsin' ], [ 'WY', 'Wyoming' ] ];
}
SampleScripts.menu.ComboScript.main = function SampleScripts_menu_ComboScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.menu.ComboScript().init();
    }));
}
SampleScripts.menu.ComboScript.prototype = {
    
    init: function SampleScripts_menu_ComboScript$init() {
        var store = new Ext.data.SimpleStore(new Ext.data.SimpleStoreConfig().fields([ 'abbr', 'state' ]).data(this._states).toDictionary());
        new Ext.form.ComboBox(new Ext.form.ComboBoxConfig().store(store).displayField('state').typeAhead(true).mode('local').triggerAction('all').emptyText('Select a state...').selectOnFocus(true).applyTo('local-states').toDictionary());
        new Ext.form.ComboBox(new Ext.form.ComboBoxConfig().typeAhead(true).triggerAction('all').transform('state').width(135).forceSelection(true).toDictionary());
    }
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.menu.CustomScript

SampleScripts.menu.CustomScript = function SampleScripts_menu_CustomScript() {
}
SampleScripts.menu.CustomScript.main = function SampleScripts_menu_CustomScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.menu.CustomScript().init();
    }));
}
SampleScripts.menu.CustomScript.prototype = {
    
    init: function SampleScripts_menu_CustomScript$init() {
        var ds = new Ext.data.Store(new Ext.data.StoreConfig().custom('proxy', new Ext.data.ScriptTagProxy(new Ext.data.ScriptTagProxyConfig().url('http://extjs.com/forum/topics-remote.php').toDictionary())).reader(new Ext.data.JsonReader(new Ext.data.JsonReaderConfig().root('topics').totalProperty('totalCount').id('post_id').toDictionary(), [ { name: 'postId', mapping: 'post_id' }, { name: 'title', mapping: 'topic_title' }, { name: 'topicId', mapping: 'topic_id' }, { name: 'author', mapping: 'author' }, { name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp' }, { name: 'excerpt', mapping: 'post_text' } ])).baseParams({ limit: 20, forumId: 4 }).toDictionary());
        var resultTpl = new Ext.XTemplate('<tpl for=\".\">\r\n\t\t\t\t<div class=\"search-item\">\r\n\t\t\t\t\t<h3><span>{lastPost:date(\"M j, Y\")}<br />by {author}</span>\r\n\t\t\t\t\t<a href=\"http://extjs.com/forum/showthread.php?t={topicId}&p={postId}\" target=\"_blank\">{title}</a></h3>\r\n\t\t\t\t\t<p>{excerpt}</p>\r\n\t\t\t\t</div></tpl>');
        new Ext.Panel(new Ext.PanelConfig().applyTo('search-panel').title('Forum Search').height(300).autoScroll(true).items(new Ext.DataView(new Ext.DataViewConfig().tpl(resultTpl).store(ds).itemSelector('div.search-item').toDictionary())).bbar(new Ext.PagingToolbar(new Ext.PagingToolbarConfig().store(ds).pageSize(20).displayInfo(true).displayMsg('Topics {0} - {1} of {2}').emptyMsg('No topics to display').toDictionary())).toDictionary());
        ds.load({ params: { start: 0, limit: 20, forumId: 4 } });
    }
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.menu.ActionsScript

SampleScripts.menu.ActionsScript = function SampleScripts_menu_ActionsScript() {
}
SampleScripts.menu.ActionsScript.main = function SampleScripts_menu_ActionsScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.menu.ActionsScript().init();
    }));
}
SampleScripts.menu.ActionsScript.prototype = {
    
    init: function SampleScripts_menu_ActionsScript$init() {
        var action = new Ext.Action(new Ext.ActionConfig().text('Action 1').handler(Delegate.create(this, function() {
            Ext.MessageBox.alert('Click', 'You clicked on \"Action 1\".');
        })).iconCls('blist').toDictionary());
        var panel = new Ext.Panel(new Ext.PanelConfig().title('Actions').width(600).height(300).custom('bodyStyle', 'padding: 10px;').tbar([ action, { text: 'Action Menu', menu: [ action ] } ]).items([ new Ext.Button(action) ]).renderTo(ExtClass.getBody()).toDictionary());
        panel.getTopToolbar().add('->', { text: 'Disable', handler: Delegate.create(this, function() {
            action.setDisabled(!action.isDisabled());
            this.setText(((action.isDisabled()) ? 'Enable' : 'Disable'));
        }) }, { text: 'Change Text', handler: Delegate.create(this, function() {
            Ext.MessageBox.prompt('Enter Text', 'Enter new text for Action 1:', Delegate.create(this, function(btn, text) {
                if (btn === 'ok' && !String.isNullOrEmpty(text)) {
                    action.setText(text);
                    action.setHandler(Delegate.create(this, function() {
                        Ext.MessageBox.alert('Click', 'You clicked on \"' + text + '\"');
                    }));
                }
            }));
        }) }, { text: 'Change Icon', handler: Delegate.create(this, function() {
            action.setIconClass(((action.getIconClass()) === 'blist') ? 'bmenu' : 'blist');
        }) });
    }
}


Type.createNamespace('SampleScripts.grid');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.grid.ArrayGridScript

SampleScripts.grid.ArrayGridScript = function SampleScripts_grid_ArrayGridScript() {
}
SampleScripts.grid.ArrayGridScript.main = function SampleScripts_grid_ArrayGridScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.grid.ArrayGridScript().init();
    }));
}
SampleScripts.grid.ArrayGridScript.prototype = {
    
    init: function SampleScripts_grid_ArrayGridScript$init() {
        var myData = this._getMyData();
        var ds = new Ext.data.Store(new Ext.data.StoreConfig().reader(new Ext.data.ArrayReader({}, [ { name: 'company' }, { name: 'price', type: 'float' }, { name: 'change', type: 'float' }, { name: 'pctChange', type: 'float' }, { name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia' } ])).toDictionary());
        ds.loadData(myData);
        var colModel = new Ext.grid.ColumnModel([ { id: 'company', header: 'Company', width: 160, sortable: true, locked: false, dataIndex: 'company' }, { header: 'Price', width: 75, sortable: true, renderer: Delegate.create(null, Ext.util.Format.usMoney), dataIndex: 'price' }, { header: 'Change', width: 75, sortable: true, renderer: Delegate.create(this, this._change), dataIndex: 'change' }, { header: '% Change', width: 75, sortable: true, renderer: Delegate.create(this, this._pctChange), dataIndex: 'pctChange' }, { header: 'Last Updated', width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange' } ]);
        var grid = new Ext.grid.GridPanel(new Ext.grid.GridPanelConfig().el('grid-example').ds(ds).cm(colModel).autoExpandColumn('company').height(350).width(600).title('Array Grid').toDictionary());
        grid.render();
        (grid.getSelectionModel()).selectFirstRow();
    },
    
    _italic: function SampleScripts_grid_ArrayGridScript$_italic(val) {
        return '<i>' + val + '</i>';
    },
    
    _change: function SampleScripts_grid_ArrayGridScript$_change(val) {
        if (val > 0) {
            return '<span style=\"color:green;\">' + val + '</span>';
        }
        else if (val < 0) {
            return '<span style=\"color:red;\">' + val + '</span>';
        }
        return val;
    },
    
    _pctChange: function SampleScripts_grid_ArrayGridScript$_pctChange(val) {
        if (val > 0) {
            return '<span style=\"color:green;\">' + val + '%</span>';
        }
        else if (val < 0) {
            return '<span style=\"color:red;\">' + val + '%</span>';
        }
        return val;
    },
    
    _getMyData: function SampleScripts_grid_ArrayGridScript$_getMyData() {
        return [ [ '3m Co', 71.72, 0.02, 0.03, '9/1 12:00am' ], [ 'Alcoa Inc', 29.01, 0.42, 1.47, '9/1 12:00am' ], [ 'Altria Group Inc', 83.81, 0.28, 0.34, '9/1 12:00am' ], [ 'American Express Company', 52.55, 0.01, 0.02, '9/1 12:00am' ], [ 'American International Group, Inc.', 64.13, 0.31, 0.49, '9/1 12:00am' ], [ 'AT&T Inc.', 31.61, -0.48, -1.54, '9/1 12:00am' ], [ 'Boeing Co.', 75.43, 0.53, 0.71, '9/1 12:00am' ], [ 'Caterpillar Inc.', 67.27, 0.92, 1.39, '9/1 12:00am' ], [ 'Citigroup, Inc.', 49.37, 0.02, 0.04, '9/1 12:00am' ], [ 'E.I. du Pont de Nemours and Company', 40.48, 0.51, 1.28, '9/1 12:00am' ], [ 'Exxon Mobil Corp', 68.1, -0.43, -0.64, '9/1 12:00am' ], [ 'General Electric Company', 34.14, -0.08, -0.23, '9/1 12:00am' ], [ 'General Motors Corporation', 30.27, 1.09, 3.74, '9/1 12:00am' ], [ 'Hewlett-Packard Co.', 36.53, -0.03, -0.08, '9/1 12:00am' ], [ 'Honeywell Intl Inc', 38.77, 0.05, 0.13, '9/1 12:00am' ], [ 'Intel Corporation', 19.88, 0.31, 1.58, '9/1 12:00am' ], [ 'International Business Machines', 81.41, 0.44, 0.54, '9/1 12:00am' ], [ 'Johnson & Johnson', 64.72, 0.06, 0.09, '9/1 12:00am' ], [ 'JP Morgan & Chase & Co', 45.73, 0.07, 0.15, '9/1 12:00am' ], [ 'McDonald\"s Corporation', 36.76, 0.86, 2.4, '9/1 12:00am' ], [ 'Merck & Co., Inc.', 40.96, 0.41, 1.01, '9/1 12:00am' ], [ 'Microsoft Corporation', 25.84, 0.14, 0.54, '9/1 12:00am' ], [ 'Pfizer Inc', 27.96, 0.4, 1.45, '9/1 12:00am' ], [ 'The Coca-Cola Company', 45.07, 0.26, 0.58, '9/1 12:00am' ], [ 'The Home Depot, Inc.', 34.64, 0.35, 1.02, '9/1 12:00am' ], [ 'The Procter & Gamble Company', 61.91, 0.01, 0.02, '9/1 12:00am' ], [ 'United Technologies Corporation', 63.26, 0.55, 0.88, '9/1 12:00am' ], [ 'Verizon Communications', 35.57, 0.39, 1.11, '9/1 12:00am' ], [ 'Wal-Mart Stores, Inc.', 45.45, 0.73, 1.63, '9/1 12:00am' ], [ '3m Co', 71.72, 0.02, 0.03, '9/1 12:00am' ], [ 'Alcoa Inc', 29.01, 0.42, 1.47, '9/1 12:00am' ], [ 'Altria Group Inc', 83.81, 0.28, 0.34, '9/1 12:00am' ], [ 'American Express Company', 52.55, 0.01, 0.02, '9/1 12:00am' ], [ 'American International Group, Inc.', 64.13, 0.31, 0.49, '9/1 12:00am' ], [ 'AT&T Inc.', 31.61, -0.48, -1.54, '9/1 12:00am' ], [ 'Boeing Co.', 75.43, 0.53, 0.71, '9/1 12:00am' ], [ 'Caterpillar Inc.', 67.27, 0.92, 1.39, '9/1 12:00am' ], [ 'Citigroup, Inc.', 49.37, 0.02, 0.04, '9/1 12:00am' ], [ 'E.I. du Pont de Nemours and Company', 40.48, 0.51, 1.28, '9/1 12:00am' ], [ 'Exxon Mobil Corp', 68.1, -0.43, -0.64, '9/1 12:00am' ], [ 'General Electric Company', 34.14, -0.08, -0.23, '9/1 12:00am' ], [ 'General Motors Corporation', 30.27, 1.09, 3.74, '9/1 12:00am' ], [ 'Hewlett-Packard Co.', 36.53, -0.03, -0.08, '9/1 12:00am' ], [ 'Honeywell Intl Inc', 38.77, 0.05, 0.13, '9/1 12:00am' ], [ 'Intel Corporation', 19.88, 0.31, 1.58, '9/1 12:00am' ], [ 'International Business Machines', 81.41, 0.44, 0.54, '9/1 12:00am' ], [ 'Johnson & Johnson', 64.72, 0.06, 0.09, '9/1 12:00am' ], [ 'JP Morgan & Chase & Co', 45.73, 0.07, 0.15, '9/1 12:00am' ], [ 'McDonald\"s Corporation', 36.76, 0.86, 2.4, '9/1 12:00am' ], [ 'Merck & Co., Inc.', 40.96, 0.41, 1.01, '9/1 12:00am' ], [ 'Microsoft Corporation', 25.84, 0.14, 0.54, '9/1 12:00am' ], [ 'Pfizer Inc', 27.96, 0.4, 1.45, '9/1 12:00am' ], [ 'The Coca-Cola Company', 45.07, 0.26, 0.58, '9/1 12:00am' ], [ 'The Home Depot, Inc.', 34.64, 0.35, 1.02, '9/1 12:00am' ], [ 'The Procter & Gamble Company', 61.91, 0.01, 0.02, '9/1 12:00am' ], [ 'United Technologies Corporation', 63.26, 0.55, 0.88, '9/1 12:00am' ], [ 'Verizon Communications', 35.57, 0.39, 1.11, '9/1 12:00am' ], [ 'Wal-Mart Stores, Inc.', 45.45, 0.73, 1.63, '9/1 12:00am' ], [ '3m Co', 71.72, 0.02, 0.03, '9/1 12:00am' ], [ 'Alcoa Inc', 29.01, 0.42, 1.47, '9/1 12:00am' ], [ 'Altria Group Inc', 83.81, 0.28, 0.34, '9/1 12:00am' ], [ 'American Express Company', 52.55, 0.01, 0.02, '9/1 12:00am' ], [ 'American International Group, Inc.', 64.13, 0.31, 0.49, '9/1 12:00am' ], [ 'AT&T Inc.', 31.61, -0.48, -1.54, '9/1 12:00am' ], [ 'Boeing Co.', 75.43, 0.53, 0.71, '9/1 12:00am' ], [ 'Caterpillar Inc.', 67.27, 0.92, 1.39, '9/1 12:00am' ], [ 'Citigroup, Inc.', 49.37, 0.02, 0.04, '9/1 12:00am' ], [ 'E.I. du Pont de Nemours and Company', 40.48, 0.51, 1.28, '9/1 12:00am' ], [ 'Exxon Mobil Corp', 68.1, -0.43, -0.64, '9/1 12:00am' ], [ 'General Electric Company', 34.14, -0.08, -0.23, '9/1 12:00am' ], [ 'General Motors Corporation', 30.27, 1.09, 3.74, '9/1 12:00am' ], [ 'Hewlett-Packard Co.', 36.53, -0.03, -0.08, '9/1 12:00am' ], [ 'Honeywell Intl Inc', 38.77, 0.05, 0.13, '9/1 12:00am' ], [ 'Intel Corporation', 19.88, 0.31, 1.58, '9/1 12:00am' ], [ 'International Business Machines', 81.41, 0.44, 0.54, '9/1 12:00am' ], [ 'Johnson & Johnson', 64.72, 0.06, 0.09, '9/1 12:00am' ], [ 'JP Morgan & Chase & Co', 45.73, 0.07, 0.15, '9/1 12:00am' ], [ 'McDonald\"s Corporation', 36.76, 0.86, 2.4, '9/1 12:00am' ], [ 'Merck & Co., Inc.', 40.96, 0.41, 1.01, '9/1 12:00am' ], [ 'Microsoft Corporation', 25.84, 0.14, 0.54, '9/1 12:00am' ], [ 'Pfizer Inc', 27.96, 0.4, 1.45, '9/1 12:00am' ], [ 'The Coca-Cola Company', 45.07, 0.26, 0.58, '9/1 12:00am' ], [ 'The Home Depot, Inc.', 34.64, 0.35, 1.02, '9/1 12:00am' ], [ 'The Procter & Gamble Company', 61.91, 0.01, 0.02, '9/1 12:00am' ], [ 'United Technologies Corporation', 63.26, 0.55, 0.88, '9/1 12:00am' ], [ 'Verizon Communications', 35.57, 0.39, 1.11, '9/1 12:00am' ], [ 'Wal-Mart Stores, Inc.', 45.45, 0.73, 1.63, '9/1 12:00am' ], [ '3m Co', 71.72, 0.02, 0.03, '9/1 12:00am' ], [ 'Alcoa Inc', 29.01, 0.42, 1.47, '9/1 12:00am' ], [ 'Altria Group Inc', 83.81, 0.28, 0.34, '9/1 12:00am' ], [ 'American Express Company', 52.55, 0.01, 0.02, '9/1 12:00am' ], [ 'American International Group, Inc.', 64.13, 0.31, 0.49, '9/1 12:00am' ], [ 'AT&T Inc.', 31.61, -0.48, -1.54, '9/1 12:00am' ], [ 'Boeing Co.', 75.43, 0.53, 0.71, '9/1 12:00am' ], [ 'Caterpillar Inc.', 67.27, 0.92, 1.39, '9/1 12:00am' ], [ 'Citigroup, Inc.', 49.37, 0.02, 0.04, '9/1 12:00am' ], [ 'E.I. du Pont de Nemours and Company', 40.48, 0.51, 1.28, '9/1 12:00am' ], [ 'Exxon Mobil Corp', 68.1, -0.43, -0.64, '9/1 12:00am' ], [ 'General Electric Company', 34.14, -0.08, -0.23, '9/1 12:00am' ], [ 'General Motors Corporation', 30.27, 1.09, 3.74, '9/1 12:00am' ], [ 'Hewlett-Packard Co.', 36.53, -0.03, -0.08, '9/1 12:00am' ], [ 'Honeywell Intl Inc', 38.77, 0.05, 0.13, '9/1 12:00am' ], [ 'Intel Corporation', 19.88, 0.31, 1.58, '9/1 12:00am' ], [ 'International Business Machines', 81.41, 0.44, 0.54, '9/1 12:00am' ], [ 'Johnson & Johnson', 64.72, 0.06, 0.09, '9/1 12:00am' ], [ 'JP Morgan & Chase & Co', 45.73, 0.07, 0.15, '9/1 12:00am' ], [ 'McDonald\"s Corporation', 36.76, 0.86, 2.4, '9/1 12:00am' ], [ 'Merck & Co., Inc.', 40.96, 0.41, 1.01, '9/1 12:00am' ], [ 'Microsoft Corporation', 25.84, 0.14, 0.54, '9/1 12:00am' ], [ 'Pfizer Inc', 27.96, 0.4, 1.45, '9/1 12:00am' ], [ 'The Coca-Cola Company', 45.07, 0.26, 0.58, '9/1 12:00am' ], [ 'The Home Depot, Inc.', 34.64, 0.35, 1.02, '9/1 12:00am' ], [ 'The Procter & Gamble Company', 61.91, 0.01, 0.02, '9/1 12:00am' ], [ 'United Technologies Corporation', 63.26, 0.55, 0.88, '9/1 12:00am' ], [ 'Verizon Communications', 35.57, 0.39, 1.11, '9/1 12:00am' ], [ 'Wal-Mart Stores, Inc.', 45.45, 0.73, 1.63, '9/1 12:00am' ], [ '3m Co', 71.72, 0.02, 0.03, '9/1 12:00am' ], [ 'Alcoa Inc', 29.01, 0.42, 1.47, '9/1 12:00am' ], [ 'Altria Group Inc', 83.81, 0.28, 0.34, '9/1 12:00am' ], [ 'American Express Company', 52.55, 0.01, 0.02, '9/1 12:00am' ], [ 'American International Group, Inc.', 64.13, 0.31, 0.49, '9/1 12:00am' ], [ 'AT&T Inc.', 31.61, -0.48, -1.54, '9/1 12:00am' ], [ 'Boeing Co.', 75.43, 0.53, 0.71, '9/1 12:00am' ], [ 'Caterpillar Inc.', 67.27, 0.92, 1.39, '9/1 12:00am' ], [ 'Citigroup, Inc.', 49.37, 0.02, 0.04, '9/1 12:00am' ], [ 'E.I. du Pont de Nemours and Company', 40.48, 0.51, 1.28, '9/1 12:00am' ], [ 'Exxon Mobil Corp', 68.1, -0.43, -0.64, '9/1 12:00am' ], [ 'General Electric Company', 34.14, -0.08, -0.23, '9/1 12:00am' ], [ 'General Motors Corporation', 30.27, 1.09, 3.74, '9/1 12:00am' ], [ 'Hewlett-Packard Co.', 36.53, -0.03, -0.08, '9/1 12:00am' ], [ 'Honeywell Intl Inc', 38.77, 0.05, 0.13, '9/1 12:00am' ], [ 'Intel Corporation', 19.88, 0.31, 1.58, '9/1 12:00am' ], [ 'International Business Machines', 81.41, 0.44, 0.54, '9/1 12:00am' ], [ 'Johnson & Johnson', 64.72, 0.06, 0.09, '9/1 12:00am' ], [ 'JP Morgan & Chase & Co', 45.73, 0.07, 0.15, '9/1 12:00am' ], [ 'McDonald\"s Corporation', 36.76, 0.86, 2.4, '9/1 12:00am' ], [ 'Merck & Co., Inc.', 40.96, 0.41, 1.01, '9/1 12:00am' ], [ 'Microsoft Corporation', 25.84, 0.14, 0.54, '9/1 12:00am' ], [ 'Pfizer Inc', 27.96, 0.4, 1.45, '9/1 12:00am' ], [ 'The Coca-Cola Company', 45.07, 0.26, 0.58, '9/1 12:00am' ], [ 'The Home Depot, Inc.', 34.64, 0.35, 1.02, '9/1 12:00am' ], [ 'The Procter & Gamble Company', 61.91, 0.01, 0.02, '9/1 12:00am' ], [ 'United Technologies Corporation', 63.26, 0.55, 0.88, '9/1 12:00am' ], [ 'Verizon Communications', 35.57, 0.39, 1.11, '9/1 12:00am' ], [ 'Wal-Mart Stores, Inc.', 45.45, 0.73, 1.63, '9/1 12:00am' ], [ '3m Co', 71.72, 0.02, 0.03, '9/1 12:00am' ], [ 'Alcoa Inc', 29.01, 0.42, 1.47, '9/1 12:00am' ], [ 'Altria Group Inc', 83.81, 0.28, 0.34, '9/1 12:00am' ], [ 'American Express Company', 52.55, 0.01, 0.02, '9/1 12:00am' ], [ 'American International Group, Inc.', 64.13, 0.31, 0.49, '9/1 12:00am' ], [ 'AT&T Inc.', 31.61, -0.48, -1.54, '9/1 12:00am' ], [ 'Boeing Co.', 75.43, 0.53, 0.71, '9/1 12:00am' ], [ 'Caterpillar Inc.', 67.27, 0.92, 1.39, '9/1 12:00am' ], [ 'Citigroup, Inc.', 49.37, 0.02, 0.04, '9/1 12:00am' ], [ 'E.I. du Pont de Nemours and Company', 40.48, 0.51, 1.28, '9/1 12:00am' ], [ 'Exxon Mobil Corp', 68.1, -0.43, -0.64, '9/1 12:00am' ], [ 'General Electric Company', 34.14, -0.08, -0.23, '9/1 12:00am' ], [ 'General Motors Corporation', 30.27, 1.09, 3.74, '9/1 12:00am' ], [ 'Hewlett-Packard Co.', 36.53, -0.03, -0.08, '9/1 12:00am' ], [ 'Honeywell Intl Inc', 38.77, 0.05, 0.13, '9/1 12:00am' ], [ 'Intel Corporation', 19.88, 0.31, 1.58, '9/1 12:00am' ], [ 'International Business Machines', 81.41, 0.44, 0.54, '9/1 12:00am' ], [ 'Johnson & Johnson', 64.72, 0.06, 0.09, '9/1 12:00am' ], [ 'JP Morgan & Chase & Co', 45.73, 0.07, 0.15, '9/1 12:00am' ], [ 'McDonald\"s Corporation', 36.76, 0.86, 2.4, '9/1 12:00am' ], [ 'Merck & Co., Inc.', 40.96, 0.41, 1.01, '9/1 12:00am' ], [ 'Microsoft Corporation', 25.84, 0.14, 0.54, '9/1 12:00am' ], [ 'Pfizer Inc', 27.96, 0.4, 1.45, '9/1 12:00am' ], [ 'The Coca-Cola Company', 45.07, 0.26, 0.58, '9/1 12:00am' ], [ 'The Home Depot, Inc.', 34.64, 0.35, 1.02, '9/1 12:00am' ], [ 'The Procter & Gamble Company', 61.91, 0.01, 0.02, '9/1 12:00am' ], [ 'United Technologies Corporation', 63.26, 0.55, 0.88, '9/1 12:00am' ], [ 'Verizon Communications', 35.57, 0.39, 1.11, '9/1 12:00am' ], [ 'Wal-Mart Stores, Inc.', 45.45, 0.73, 1.63, '9/1 12:00am' ], [ '3m Co', 71.72, 0.02, 0.03, '9/1 12:00am' ], [ 'Alcoa Inc', 29.01, 0.42, 1.47, '9/1 12:00am' ], [ 'Altria Group Inc', 83.81, 0.28, 0.34, '9/1 12:00am' ], [ 'American Express Company', 52.55, 0.01, 0.02, '9/1 12:00am' ], [ 'American International Group, Inc.', 64.13, 0.31, 0.49, '9/1 12:00am' ], [ 'AT&T Inc.', 31.61, -0.48, -1.54, '9/1 12:00am' ], [ 'Boeing Co.', 75.43, 0.53, 0.71, '9/1 12:00am' ], [ 'Caterpillar Inc.', 67.27, 0.92, 1.39, '9/1 12:00am' ], [ 'Citigroup, Inc.', 49.37, 0.02, 0.04, '9/1 12:00am' ], [ 'E.I. du Pont de Nemours and Company', 40.48, 0.51, 1.28, '9/1 12:00am' ], [ 'Exxon Mobil Corp', 68.1, -0.43, -0.64, '9/1 12:00am' ], [ 'General Electric Company', 34.14, -0.08, -0.23, '9/1 12:00am' ], [ 'General Motors Corporation', 30.27, 1.09, 3.74, '9/1 12:00am' ], [ 'Hewlett-Packard Co.', 36.53, -0.03, -0.08, '9/1 12:00am' ], [ 'Honeywell Intl Inc', 38.77, 0.05, 0.13, '9/1 12:00am' ], [ 'Intel Corporation', 19.88, 0.31, 1.58, '9/1 12:00am' ], [ 'International Business Machines', 81.41, 0.44, 0.54, '9/1 12:00am' ], [ 'Johnson & Johnson', 64.72, 0.06, 0.09, '9/1 12:00am' ], [ 'JP Morgan & Chase & Co', 45.73, 0.07, 0.15, '9/1 12:00am' ], [ 'McDonald\"s Corporation', 36.76, 0.86, 2.4, '9/1 12:00am' ], [ 'Merck & Co., Inc.', 40.96, 0.41, 1.01, '9/1 12:00am' ], [ 'Microsoft Corporation', 25.84, 0.14, 0.54, '9/1 12:00am' ], [ 'Pfizer Inc', 27.96, 0.4, 1.45, '9/1 12:00am' ], [ 'The Coca-Cola Company', 45.07, 0.26, 0.58, '9/1 12:00am' ], [ 'The Home Depot, Inc.', 34.64, 0.35, 1.02, '9/1 12:00am' ], [ 'The Procter & Gamble Company', 61.91, 0.01, 0.02, '9/1 12:00am' ], [ 'United Technologies Corporation', 63.26, 0.55, 0.88, '9/1 12:00am' ] ];
    }
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.grid.EditGridScript

SampleScripts.grid.EditGridScript = function SampleScripts_grid_EditGridScript() {
}
SampleScripts.grid.EditGridScript.main = function SampleScripts_grid_EditGridScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.grid.EditGridScript().init();
    }));
}
SampleScripts.grid.EditGridScript.prototype = {
    
    init: function SampleScripts_grid_EditGridScript$init() {
        var checkCol = new SampleScripts.grid.CheckColumn(new Ext.grid.ColumnModelConfig().header('Indoor?').dataIndex('indoor').width(55).toDictionary());
        var cm = new Ext.grid.ColumnModel([ new Ext.grid.ColumnModelConfig().id('common').header('Common Name').dataIndex('common').width(220).editor(new Ext.form.TextField(new Ext.form.TextFieldConfig().allowBlank(false).toDictionary())).toDictionary(), new Ext.grid.ColumnModelConfig().header('Light').dataIndex('light').width(130).editor(new Ext.form.ComboBox(new Ext.form.ComboBoxConfig().typeAhead(true).triggerAction('all').transform('light').lazyRender(true).listClass('x-combo-list-small').toDictionary())).toDictionary(), new Ext.grid.ColumnModelConfig().header('Price').dataIndex('price').width(70).align('right').renderer(Delegate.create(null, Ext.util.Format.usMoney)).editor(new Ext.form.NumberField(new Ext.form.NumberFieldConfig().allowBlank(false).allowNegative(false).maxValue(100000).toDictionary())).toDictionary(), new Ext.grid.ColumnModelConfig().header('Available').dataIndex('availDate').width(95).renderer(Delegate.create(this, this.formatDate)).editor(new Ext.form.DateField(new Ext.form.DateFieldConfig().format('m/d/y').minValue('01/01/06').disabledDays([ 0, 6 ]).disabledDaysText('Plants are not available on the weekends').toDictionary())).toDictionary(), checkCol ]);
        cm.defaultSortable = true;
        var plantDef = [ { name: 'common', type: 'string' }, { name: 'botanical', type: 'string' }, { name: 'light' }, { name: 'price', type: 'float' }, { name: 'availDate', mapping: 'availability', type: 'date', dateFormat: 'm/d/Y' }, { name: 'indoor', type: 'bool' } ];
        var ds = new Ext.data.Store(new Ext.data.StoreConfig().url('plants.xml').reader(new Ext.data.XmlReader(new Ext.data.XmlReaderConfig().record('plant').toDictionary(), plantDef)).sortInfo({ field: 'common', direction: 'ASC' }).toDictionary());
        var grid = null;
        grid = new Ext.grid.EditorGridPanel(new Ext.grid.EditorGridPanelConfig().ds(ds).cm(cm).renderTo('editor-grid').width(600).height(300).autoExpandColumn('common').title('Edit Plants?').frame(true).plugins(checkCol).clicksToEdit(1).tbar([ { text: 'Add Plant', handler: Delegate.create(this, function() {
            var p = new Ext.data.Record(plantDef);
            grid.stopEditing();
            ds.insert(0, [ p ]);
            p.set('common', 'New Plant 1');
            p.set('light', 'Mostly Shade');
            p.set('price', 0);
            p.set('availDate', new Date());
            p.set('indoor', false);
            grid.startEditing(0, 0);
        }) } ]).toDictionary());
        ds.load();
    },
    
    formatBoolean: function SampleScripts_grid_EditGridScript$formatBoolean(value) {
        return (value) ? 'Yes' : 'No';
    },
    
    formatDate: function SampleScripts_grid_EditGridScript$formatDate(value) {
        return (isNullOrUndefined(value)) ? '' : value.dateFormat('M d, Y');
    }
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.grid.CheckColumn

SampleScripts.grid.CheckColumn = function SampleScripts_grid_CheckColumn(config) {
    ExtClass.apply(this, config, null);
    if (isNullOrUndefined(this.id)) {
        this.id = ExtClass.id();
    }
}
SampleScripts.grid.CheckColumn.prototype = {
    id: null,
    dataIndex: null,
    grid: null,
    
    init: function SampleScripts_grid_CheckColumn$init(g) {
        this.grid = g;
        this.grid.on('render', Delegate.create(this, function() {
            var view = this.grid.getView();
            var el = view.mainBody;
            el.on('mousedown', Delegate.create(this, this.onMouseDown), this);
        }), this);
    },
    
    onMouseDown: function SampleScripts_grid_CheckColumn$onMouseDown(e, t) {
        if (!isNullOrUndefined(t.className) && t.className.indexOf('x-grid3-cc-' + this.id) !== -1) {
            e.stopEvent();
            var index = this.grid.getView().findRowIndex(t);
            var record = this.grid.store.getAt(index);
            var val = record.get(this.dataIndex);
            record.set(this.dataIndex, !val);
        }
    },
    
    renderer: function SampleScripts_grid_CheckColumn$renderer(value, p, record) {
        p['css'] += ' x-grid3-check-col-td';
        return '<div class=\"x-grid3-check-col' + ((value) ? '-on' : '') + ' x-grid3-cc-' + this.id + '\">&#160;</div>';
    }
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.grid.GroupingGridScript

SampleScripts.grid.GroupingGridScript = function SampleScripts_grid_GroupingGridScript() {
}
SampleScripts.grid.GroupingGridScript.main = function SampleScripts_grid_GroupingGridScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.grid.GroupingGridScript().init();
    }));
}
SampleScripts.grid.GroupingGridScript.prototype = {
    
    init: function SampleScripts_grid_GroupingGridScript$init() {
        var reader = new Ext.data.ArrayReader(new Ext.data.ArrayReaderConfig().toDictionary(), [ { name: 'company' }, { name: 'price', type: 'float' }, { name: 'change', type: 'float' }, { name: 'pctChange', type: 'float' }, { name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia' }, { name: 'industry' }, { name: 'desc' } ]);
        var gds = new Ext.data.GroupingStore(new Ext.data.GroupingStoreConfig().reader(reader).data(this._getData()).sortInfo({ field: 'company', direction: 'ASC' }).groupField('industry').toDictionary());
        var columns = [ { id: 'company', header: 'Company', width: 60, sortable: true, dataIndex: 'company' }, { header: 'Price', width: 20, sortable: true, renderer: Delegate.create(null, Ext.util.Format.usMoney), dataIndex: 'price' }, { header: 'Change', width: 20, sortable: true, dataIndex: 'change', renderer: Delegate.create(null, Ext.util.Format.usMoney) }, { header: 'Industry', width: 20, sortable: true, dataIndex: 'industry' }, { header: 'Last Updated', width: 20, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange' } ];
        var view = new Ext.grid.GroupingView(new Ext.grid.GroupingViewConfig().forceFit(true).groupTextTpl('{text} ({[values.rs.length]} {[values.rs.length > 1 ? \"Items\" : \"Item\"]})').toDictionary());
        var grid = new Ext.grid.GridPanel(new Ext.grid.GridPanelConfig().ds(gds).columns(columns).view(view).frame(true).width(700).height(400).collapsible(true).animCollapse(false).title('Grouping Example').iconCls('icon-grid').toDictionary());
        grid.render(document.body);
    },
    
    _getData: function SampleScripts_grid_GroupingGridScript$_getData() {
        return [ [ '3m Co', 71.72, 0.02, 0.03, '4/2 12:00am', 'Manufacturing' ], [ 'Alcoa Inc', 29.01, 0.42, 1.47, '4/1 12:00am', 'Manufacturing' ], [ 'Altria Group Inc', 83.81, 0.28, 0.34, '4/3 12:00am', 'Manufacturing' ], [ 'American Express Company', 52.55, 0.01, 0.02, '4/8 12:00am', 'Finance' ], [ 'American International Group, Inc.', 64.13, 0.31, 0.49, '4/1 12:00am', 'Services' ], [ 'AT&T Inc.', 31.61, -0.48, -1.54, '4/8 12:00am', 'Services' ], [ 'Boeing Co.', 75.43, 0.53, 0.71, '4/8 12:00am', 'Manufacturing' ], [ 'Caterpillar Inc.', 67.27, 0.92, 1.39, '4/1 12:00am', 'Services' ], [ 'Citigroup, Inc.', 49.37, 0.02, 0.04, '4/4 12:00am', 'Finance' ], [ 'E.I. du Pont de Nemours and Company', 40.48, 0.51, 1.28, '4/1 12:00am', 'Manufacturing' ], [ 'Exxon Mobil Corp', 68.1, -0.43, -0.64, '4/3 12:00am', 'Manufacturing' ], [ 'General Electric Company', 34.14, -0.08, -0.23, '4/3 12:00am', 'Manufacturing' ], [ 'General Motors Corporation', 30.27, 1.09, 3.74, '4/3 12:00am', 'Automotive' ], [ 'Hewlett-Packard Co.', 36.53, -0.03, -0.08, '4/3 12:00am', 'Computer' ], [ 'Honeywell Intl Inc', 38.77, 0.05, 0.13, '4/3 12:00am', 'Manufacturing' ], [ 'Intel Corporation', 19.88, 0.31, 1.58, '4/2 12:00am', 'Computer' ], [ 'International Business Machines', 81.41, 0.44, 0.54, '4/1 12:00am', 'Computer' ], [ 'Johnson & Johnson', 64.72, 0.06, 0.09, '4/2 12:00am', 'Medical' ], [ 'JP Morgan & Chase & Co', 45.73, 0.07, 0.15, '4/2 12:00am', 'Finance' ], [ 'McDonald\"s Corporation', 36.76, 0.86, 2.4, '4/2 12:00am', 'Food' ], [ 'Merck & Co., Inc.', 40.96, 0.41, 1.01, '4/2 12:00am', 'Medical' ], [ 'Microsoft Corporation', 25.84, 0.14, 0.54, '4/2 12:00am', 'Computer' ], [ 'Pfizer Inc', 27.96, 0.4, 1.45, '4/8 12:00am', 'Services', 'Medical' ], [ 'The Coca-Cola Company', 45.07, 0.26, 0.58, '4/1 12:00am', 'Food' ], [ 'The Home Depot, Inc.', 34.64, 0.35, 1.02, '4/8 12:00am', 'Retail' ], [ 'The Procter & Gamble Company', 61.91, 0.01, 0.02, '4/1 12:00am', 'Manufacturing' ], [ 'United Technologies Corporation', 63.26, 0.55, 0.88, '4/1 12:00am', 'Computer' ], [ 'Verizon Communications', 35.57, 0.39, 1.11, '4/3 12:00am', 'Services' ], [ 'Wal-Mart Stores, Inc.', 45.45, 0.73, 1.63, '4/3 12:00am', 'Retail' ], [ 'Walt Disney Company (The) (Holding Company)', 29.89, 0.24, 0.81, '4/1 12:00am', 'Services' ] ];
    }
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.grid.PagingGridScript

SampleScripts.grid.PagingGridScript = function SampleScripts_grid_PagingGridScript() {
}
SampleScripts.grid.PagingGridScript.main = function SampleScripts_grid_PagingGridScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.grid.PagingGridScript().init();
    }));
}
SampleScripts.grid.PagingGridScript.prototype = {
    _grid: null,
    _cm: null,
    
    init: function SampleScripts_grid_PagingGridScript$init() {
        var ds = new Ext.data.Store(new Ext.data.StoreConfig().custom('proxy', new Ext.data.ScriptTagProxy(new Ext.data.ScriptTagProxyConfig().url('http://extjs.com/forum/topics-browse-remote.php').toDictionary())).reader(new Ext.data.JsonReader(new Ext.data.JsonReaderConfig().root('topics').totalProperty('totalCount').id('threadid').toDictionary(), [ 'title', 'forumtitle', 'forumid', 'author', { name: 'replycount', type: 'int' }, { name: 'lastpost', mapping: 'lastpost', type: 'date', dateFormat: 'timestamp' }, 'lastposter', 'excerpt' ])).remoteSort(true).toDictionary());
        ds.setDefaultSort('lastpost', 'desc');
        this._cm = new Ext.grid.ColumnModel([ new Ext.grid.ColumnModelConfig().id('topic').header('Topic').dataIndex('title').width(420).renderer(Delegate.create(this, this._renderTopic)).toDictionary(), new Ext.grid.ColumnModelConfig().header('Author').dataIndex('author').width(100).hidden(true).toDictionary(), new Ext.grid.ColumnModelConfig().header('Replies').dataIndex('replycount').width(70).align('right').toDictionary(), new Ext.grid.ColumnModelConfig().id('last').header('Last Post').dataIndex('lastpost').width(150).renderer(Delegate.create(this, this._renderLast)).toDictionary() ]);
        this._cm.defaultSortable = true;
        var tb = new Ext.PagingToolbar(new Ext.PagingToolbarConfig().pageSize(25).store(ds).displayInfo(true).displayMsg('Displaying topics {0} - {1} of {2}').emptyMsg('No topics to display').items([ '-', new Ext.ButtonConfig().pressed(true).enableToggle(true).text('Show Preview').cls('x-btn-text-icon details').toggleHandler(Delegate.create(this, this._toggleDetails)).toDictionary() ]).toDictionary());
        var viewConfig = new Ext.grid.GridViewConfig().forceFit(true).enableRowBody(true).custom('showPreview', true).getRowClass(Delegate.create(this, this._getRowClass));
        this._grid = new Ext.grid.GridPanel(new Ext.grid.GridPanelConfig().el('topic-grid').width(700).height(500).title('ExtJS.com - Browse Forums').store(ds).cm(this._cm).trackMouseOver(false).sm(new Ext.grid.RowSelectionModel({ selectRow: Delegate.create(null, ExtClass.emptyFn) })).loadMask(true).viewConfig(viewConfig.toDictionary()).bbar(tb).toDictionary());
        this._grid.render();
        ds.load({ params: { start: 0, limit: 25, forumId: 4 } });
    },
    
    _toggleDetails: function SampleScripts_grid_PagingGridScript$_toggleDetails(btn, pressed) {
        var view = this._grid.getView();
        view.showPreview = pressed;
        view.refresh();
    },
    
    _getRowClass: function SampleScripts_grid_PagingGridScript$_getRowClass(record, index, rowParams, ds) {
        if (this._grid.getView().showPreview) {
            rowParams['body'] = '<p>' + record.get('excerpt') + '</p>';
            return 'x-grid3-row-expanded';
        }
        return 'x-grid3-row-collapsed';
    },
    
    _renderTopic: function SampleScripts_grid_PagingGridScript$_renderTopic(value, meta, rec) {
        return String.format('<b><a href=\"http://extjs.com/forum/showthread.php?t={2}\" target=\"_blank\">{0}</a></b>' + '<a href=\"http://extjs.com/forum/forumdisplay.php?f={3}\" target=\"_blank\">{1} Forum</a>', value, rec.get('forumtitle'), rec.get('id'), rec.get('forumid'));
    },
    
    _renderLast: function SampleScripts_grid_PagingGridScript$_renderLast(value, meta, rec) {
        return String.format('{0}<br/>by {1}', value.dateFormat('M j, Y, g:i a'), rec.get('author'));
    }
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.grid.TotalsGridScript

SampleScripts.grid.TotalsGridScript = function SampleScripts_grid_TotalsGridScript() {
}
SampleScripts.grid.TotalsGridScript.main = function SampleScripts_grid_TotalsGridScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.grid.TotalsGridScript().init();
    }));
}
SampleScripts.grid.TotalsGridScript.prototype = {
    
    init: function SampleScripts_grid_TotalsGridScript$init() {
        var reader = new Ext.data.JsonReader(new Ext.data.JsonReaderConfig().custom('idProperty', 'taskId').custom('fields', [ { name: 'projectId', type: 'int' }, { name: 'project', type: 'string' }, { name: 'taskId', type: 'int' }, { name: 'description', type: 'string' }, { name: 'estimate', type: 'float' }, { name: 'rate', type: 'float' }, { name: 'cost', type: 'float' }, { name: 'due', type: 'date', dateFormat: 'm/d/Y' } ]).toDictionary());
    },
    
    _getData: function SampleScripts_grid_TotalsGridScript$_getData() {
        return [ { projectId: 100, project: 'Ext Forms: Field Anchoring' }, { projectId: 101, project: 'Ext Grid: Single-level Grouping' }, { projectId: 102, project: 'Ext Grid: Summary Rows' } ];
    },
    
    _getProjects: function SampleScripts_grid_TotalsGridScript$_getProjects() {
        return [ { projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 112, description: 'Integrate 2.0 Forms with 2.0 Layouts', estimate: 6, rate: 150, due: '06/24/2007' }, { projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 113, description: 'Implement AnchorLayout', estimate: 4, rate: 150, due: '06/25/2007' }, { projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 114, description: 'Add support for multiple types of anchors', estimate: 4, rate: 150, due: '06/27/2007' }, { projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 115, description: 'Testing and debugging', estimate: 8, rate: 0, due: '06/29/2007' }, { projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 101, description: 'Add required rendering \"hooks\" to GridView', estimate: 6, rate: 100, due: '07/01/2007' }, { projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 102, description: 'Extend GridView and override rendering functions', estimate: 6, rate: 100, due: '07/03/2007' }, { projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 103, description: 'Extend Store with grouping functionality', estimate: 4, rate: 100, due: '07/04/2007' }, { projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 121, description: 'Default CSS Styling', estimate: 2, rate: 100, due: '07/05/2007' }, { projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 104, description: 'Testing and debugging', estimate: 6, rate: 100, due: '07/06/2007' }, { projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 105, description: 'Ext Grid plugin integration', estimate: 4, rate: 125, due: '07/01/2007' }, { projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 106, description: 'Summary creation during rendering phase', estimate: 4, rate: 125, due: '07/02/2007' }, { projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 107, description: 'Dynamic summary updates in editor grids', estimate: 6, rate: 125, due: '07/05/2007' }, { projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 108, description: 'Remote summary integration', estimate: 4, rate: 125, due: '07/05/2007' }, { projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 109, description: 'Summary renderers and calculators', estimate: 4, rate: 125, due: '07/06/2007' }, { projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 110, description: 'Integrate summaries with GroupingView', estimate: 10, rate: 125, due: '07/11/2007' }, { projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 111, description: 'Testing and debugging', estimate: 8, rate: 125, due: '07/15/2007' } ];
    }
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.grid.XmlGridScript

SampleScripts.grid.XmlGridScript = function SampleScripts_grid_XmlGridScript() {
}
SampleScripts.grid.XmlGridScript.main = function SampleScripts_grid_XmlGridScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.grid.XmlGridScript().init();
    }));
}
SampleScripts.grid.XmlGridScript.prototype = {
    
    init: function SampleScripts_grid_XmlGridScript$init() {
        var ds = new Ext.data.Store(new Ext.data.StoreConfig().url('sheldon.xml').reader(new Ext.data.XmlReader(new Ext.data.XmlReaderConfig().record('Item').id('ASIN').totalRecords('@total').toDictionary(), [ { name: 'Author', mapping: 'ItemAttributes > Author' }, 'Title', 'Manufacturer', 'ProductGroup' ])).toDictionary());
        var cm = new Ext.grid.ColumnModel([ new Ext.grid.ColumnModelConfig().header('Author').width(120).dataIndex('Author').toDictionary(), new Ext.grid.ColumnModelConfig().header('Title').width(180).dataIndex('Title').toDictionary(), new Ext.grid.ColumnModelConfig().header('Manufacturer').width(115).dataIndex('Manufacturer').toDictionary(), new Ext.grid.ColumnModelConfig().header('Product Group').width(100).dataIndex('ProductGroup').toDictionary() ]);
        cm.defaultSortable = true;
        var grid = new Ext.grid.GridPanel(new Ext.grid.GridPanelConfig().ds(ds).cm(cm).renderTo('example-grid').width(540).height(200).toDictionary());
        ds.load();
    }
}


Type.createNamespace('SampleScripts.messagebox');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.messagebox.MessageBoxScript

SampleScripts.messagebox.MessageBoxScript = function SampleScripts_messagebox_MessageBoxScript() {
}
SampleScripts.messagebox.MessageBoxScript.main = function SampleScripts_messagebox_MessageBoxScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.messagebox.MessageBoxScript().init();
    }));
}
SampleScripts.messagebox.MessageBoxScript._showResult = function SampleScripts_messagebox_MessageBoxScript$_showResult(btn, text) {
    Ext.MessageBox.alert('Button Click', String.format('You clicked the {0} button', btn));
}
SampleScripts.messagebox.MessageBoxScript._showResultText = function SampleScripts_messagebox_MessageBoxScript$_showResultText(btn, text) {
    Ext.MessageBox.alert('Button Click', String.format('You clicked the {0} button and entered the text \"{1}\".', btn, text));
}
SampleScripts.messagebox.MessageBoxScript._getProgressFunc = function SampleScripts_messagebox_MessageBoxScript$_getProgressFunc(i) {
    return Delegate.create(null, function() {
        if (i === 12) {
            Ext.MessageBox.hide();
            Ext.MessageBox.alert('Done', 'Your fake items were loaded!');
        }
        else {
            var v = i / 11;
            Ext.MessageBox.updateProgress(v, Math.round(100 * v) + '% completed');
        }
    });
}
SampleScripts.messagebox.MessageBoxScript.prototype = {
    
    init: function SampleScripts_messagebox_MessageBoxScript$init() {
        ExtClass.get('mb1').on('click', Delegate.create(this, function() {
            Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?', Delegate.create(null, SampleScripts.messagebox.MessageBoxScript._showResult));
        }));
        ExtClass.get('mb2').on('click', Delegate.create(this, function() {
            Ext.MessageBox.prompt('Name', 'Please enter your name:', Delegate.create(null, SampleScripts.messagebox.MessageBoxScript._showResultText));
        }));
        ExtClass.get('mb3').on('click', Delegate.create(this, function() {
            Ext.MessageBox.show({ title: 'Address', msg: 'Please enter your address:', width: 300, buttons: Ext.MessageBox.OKCANCEL, multiline: true, fn: Delegate.create(null, SampleScripts.messagebox.MessageBoxScript._showResultText), animEl: 'mb3' });
        }));
        ExtClass.get('mb4').on('click', Delegate.create(this, function() {
            Ext.MessageBox.show({ title: 'Save Changes?', msg: 'You are closing a tab that has unsaved changes. <br />Would you like to save your changes?', buttons: Ext.MessageBox.YESNOCANCEL, fn: Delegate.create(null, SampleScripts.messagebox.MessageBoxScript._showResult), animEl: 'mb4', icon: Ext.MessageBox.QUESTION });
        }));
        ExtClass.get('mb6').on('click', Delegate.create(this, function() {
            Ext.MessageBox.show({ title: 'Please wait', msg: 'Loading items...', progressText: 'Initializing...', width: 300, progress: true, closable: false, animEl: 'mb6' });
            for (var i = 1; i < 13; i++) {
                window.setTimeout(SampleScripts.messagebox.MessageBoxScript._getProgressFunc(i), i * 500);
            }
        }));
        ExtClass.get('mb7').on('click', Delegate.create(this, function() {
            Ext.MessageBox.show({ msg: 'Saving your data, please wait...', progressText: 'Saving...', width: 300, wait: true, waitConfig: { interval: 200 }, icon: 'ext-mb-download', animEl: 'mb7' });
            window.setTimeout(Delegate.create(this, function() {
                Ext.MessageBox.hide();
                Ext.MessageBox.alert('Done', 'Your fake data was saved!');
            }), 8000);
        }));
        ExtClass.get('mb8').on('click', Delegate.create(this, function() {
            Ext.MessageBox.alert('Status', 'Changes saved successfully.', Delegate.create(null, SampleScripts.messagebox.MessageBoxScript._showResult));
        }));
        ExtClass.fly('info').dom.value = Ext.MessageBox.INFO;
        ExtClass.fly('question').dom.value = Ext.MessageBox.QUESTION;
        ExtClass.fly('warning').dom.value = Ext.MessageBox.WARNING;
        ExtClass.fly('error').dom.value = Ext.MessageBox.ERROR;
        ExtClass.get('mb9').on('click', Delegate.create(this, function() {
            Ext.MessageBox.show({ title: 'Icon Support', msg: 'Here is a message with an icon!', buttons: Ext.MessageBox.OK, animEl: 'mb9', fn: Delegate.create(null, SampleScripts.messagebox.MessageBoxScript._showResult), icon: ExtClass.get('icons').dom.value });
        }));
    }
}


Type.createNamespace('SampleScripts.panel');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.panel.PanelScript

SampleScripts.panel.PanelScript = function SampleScripts_panel_PanelScript() {
}
SampleScripts.panel.PanelScript.main = function SampleScripts_panel_PanelScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.panel.PanelScript().init();
    }));
}
SampleScripts.panel.PanelScript.prototype = {
    
    init: function SampleScripts_panel_PanelScript$init() {
        new Ext.Panel(new Ext.PanelConfig().title('My Panel').collapsible(true).renderTo(document.body).width(400).html(SampleScripts.panel.PanelScript._html).toDictionary());
    }
}


Type.createNamespace('SampleScripts');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.SamplePanel

SampleScripts.SamplePanel = function SampleScripts_SamplePanel(config) {
    SampleScripts.SamplePanel.constructBase(this);
    SampleScripts.SamplePanel.superclass.constructor.call(this, config);
}
SampleScripts.SamplePanel.prototype = {
    autoHeight: true,
    frame: true,
    collapsible: true,
    cls: 'demos',
    
    afterRender: function SampleScripts_SamplePanel$afterRender() {
        SampleScripts.SamplePanel.superclass.afterRender.call(this);
        SampleScripts.SamplePanel.tpl.overwrite(this.body, this);
    }
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.DefaultScript

SampleScripts.DefaultScript = function SampleScripts_DefaultScript() {
}
SampleScripts.DefaultScript.main = function SampleScripts_DefaultScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.DefaultScript().init();
    }));
}
SampleScripts.DefaultScript.prototype = {
    
    init: function SampleScripts_DefaultScript$init() {
        var catalog = [ { title: 'Grids', samples: [ { text: 'Basic Array Grid', url: 'grid/array-grid.aspx', icon: 'grid-array.gif' }, { text: 'Editable Grid', url: 'grid/edit-grid.aspx', icon: 'grid-edit.gif' }, { text: 'XML Grid', url: 'grid/xml-grid.aspx', icon: 'grid-xml.gif' }, { text: 'Paging', url: 'grid/paging.aspx', icon: 'grid-paging.gif' }, { text: 'Grouping', url: 'grid/grouping.aspx', icon: 'grid-grouping.gif' }, { text: 'Live Group Summary', url: 'grid/totals.aspx', icon: 'grid-summary.gif' }, { text: 'Customizing: Grid Plugins', url: 'grid/grid3.aspx', icon: 'grid-plugins.gif' } ] }, { title: 'Tabs', samples: [ { text: 'Basic Tabs', url: 'tabs/tabs.aspx', icon: 'tabs.gif' }, { text: 'Advanced Tabs', url: 'tabs/tabs-adv.aspx', icon: 'tabs-adv.gif' } ] }, { title: 'Windows', samples: [ { text: 'Hello World', url: 'window/hello.aspx', icon: 'window.gif' }, { text: 'MessageBox', url: 'message-box/msg-box.aspx', icon: 'msg-box.gif' } ] }, { title: 'Trees', samples: [ { text: 'Drag and Drop Reordering', url: 'tree/reorder.aspx', icon: 'tree-reorder.gif' }, { text: 'Multiple trees', url: 'tree/two-trees.aspx', icon: 'tree-two.gif' }, { text: 'Customizing: Column Tree', url: 'tree/column-tree.aspx', icon: 'tree-columns.gif' } ] }, { title: 'Layout Managers', samples: [ { text: 'Border Layout', url: 'layout/complex.aspx', icon: 'border-layout.gif' }, { text: 'Anchor Layout', url: 'form/anchoring.aspx', icon: 'anchor.gif' }, { text: 'Customizing: Portals', url: 'layout/portal.aspx', icon: 'portal.gif' } ] }, { title: 'ComboBox', samples: [ { text: 'Basic ComboBox', url: 'form/combos.aspx', icon: 'combo.gif' }, { text: 'Customizing: ComboBox Templates', url: 'form/forum-search.aspx', icon: 'combo-custom.gif' } ] }, { title: 'Forms', samples: [ { text: 'Dynamic Forms', url: 'form/dynamic.aspx', icon: 'form-dynamic.gif' }, { text: 'Ajax with XML Forms', url: 'form/xml-form.aspx', icon: 'form-xml.gif' }, { text: 'Customizing: Search Field', url: 'form/custom.aspx', icon: 'form-custom.gif' } ] }, { title: 'Toolbars and Menus', samples: [ { text: 'Basic Toolbar', url: 'menu/menus.aspx', icon: 'toolbar.gif' }, { text: 'Ext Actions', url: 'menu/actions.aspx', icon: 'toolbar-actions.gif' } ] }, { title: 'Miscellaneous', samples: [ { text: 'DataView', url: 'view/data-view.aspx', icon: 'data-view.gif' }, { text: 'Progress Bar', url: 'simple-widgets/progress-bar.aspx', icon: 'progress.gif' }, { text: 'Templates', url: 'core/templates.aspx', icon: 'templates.gif' }, { text: 'Panels', url: 'panel/panels.aspx', icon: 'panel.gif' }, { text: 'Resizable', url: 'resizable/basic.aspx', icon: 'resizable.gif' } ] } ];
        for (var i = 0; i < catalog.length; i++) {
            var c = catalog[i];
            c['id'] = 'sample-' + i;
            new SampleScripts.SamplePanel(c).render('all-demos');
        }
        var tpl = new Ext.XTemplate('<dl><tpl for=\".\"><dt><a href=\"#{id}\">{title:stripTags}</a></dt></tpl></dl>');
        tpl.overwrite('demo-menu', catalog);
        ExtClass.select('#sample-spacer').remove();
        ExtClass.get('loading').fadeOut({ remove: true });
    }
}


Type.createNamespace('SampleScripts.resizable');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.resizable.BasicScript

SampleScripts.resizable.BasicScript = function SampleScripts_resizable_BasicScript() {
}
SampleScripts.resizable.BasicScript.main = function SampleScripts_resizable_BasicScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.resizable.BasicScript().init();
    }));
}
SampleScripts.resizable.BasicScript.prototype = {
    
    init: function SampleScripts_resizable_BasicScript$init() {
        new Ext.Resizable('basic', new Ext.ResizableConfig().width(200).height(100).minWidth(100).minHeight(50).toDictionary());
        new Ext.Resizable('animated', new Ext.ResizableConfig().width(200).pinned(true).height(100).minWidth(100).minHeight(50).animate(true).easing('backIn').custom('duration', 0.6).toDictionary());
        new Ext.Resizable('wrapped', new Ext.ResizableConfig().wrap(true).pinned(true).minWidth(50).minHeight(50).preserveRatio(true).toDictionary());
        new Ext.Resizable('transparent', new Ext.ResizableConfig().wrap(true).minWidth(50).minHeight(50).preserveRatio(true).transparent(true).toDictionary());
        var custom = new Ext.Resizable('custom', new Ext.ResizableConfig().wrap(true).pinned(true).minWidth(50).minHeight(50).preserveRatio(true).handles('all').draggable(true).dynamic(true).toDictionary());
        var customEl = custom.getEl();
        document.body.insertBefore(customEl.dom, document.body.firstChild);
        customEl.on('dblclick', Delegate.create(this, function() {
            customEl.hide(true);
        }));
        customEl.hide();
        ExtClass.get('showMe').on('click', Delegate.create(this, function() {
            customEl.center();
            customEl.show(true);
        }));
        new Ext.Resizable('dwrapped', new Ext.ResizableConfig().wrap(true).pinned(true).width(450).height(150).minWidth(200).minHeight(50).dynamic(true).toDictionary());
        new Ext.Resizable('snap', new Ext.ResizableConfig().wrap(true).width(250).height(100).handles('e').widthIncrement(50).minWidth(500).dynamic(true).toDictionary());
    }
}


Type.createNamespace('SampleScripts.simple_widgets');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.simple_widgets.ProgressBarScript

SampleScripts.simple_widgets.ProgressBarScript = function SampleScripts_simple_widgets_ProgressBarScript() {
}
SampleScripts.simple_widgets.ProgressBarScript.main = function SampleScripts_simple_widgets_ProgressBarScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.simple_widgets.ProgressBarScript().init();
    }));
}
SampleScripts.simple_widgets.ProgressBarScript.prototype = {
    
    init: function SampleScripts_simple_widgets_ProgressBarScript$init() {
        var pbar1 = new Ext.ProgressBar(new Ext.ProgressBarConfig().custom('text', 'Initializing...').toDictionary());
        var btn1 = ExtClass.get('btn1');
        btn1.on('click', Delegate.create(this, function() {
            ExtClass.fly('p1text').update('Working');
            if (!pbar1.rendered) {
                pbar1.render('p1');
            }
            else {
                pbar1.text = 'Initializing...';
                pbar1.show();
            }
            SampleScripts.simple_widgets._runner.run(pbar1, ExtClass.get('btn1'), 10, Delegate.create(this, function() {
                pbar1.reset(true);
                ExtClass.fly('p1text').update('Done.').show();
            }));
        }));
        var pbar2 = new Ext.ProgressBar(new Ext.ProgressBarConfig().custom('text', 'Ready').id('pbar2').cls('left-align').renderTo('p2').toDictionary());
        var btn2 = ExtClass.get('btn2');
        btn2.on('click', Delegate.create(this, function() {
            SampleScripts.simple_widgets._runner.run(pbar2, btn2, 12, Delegate.create(this, function() {
                pbar2.reset();
                pbar2.updateText('Done.');
            }));
        }));
        var pbar3 = new Ext.ProgressBar(new Ext.ProgressBarConfig().id('pbar3').width(300).renderTo('p3').toDictionary());
        pbar3.on('update', Delegate.create(this, function() {
            ExtClass.fly('p3text').dom.innerHTML += '.';
        }));
        var btn3 = ExtClass.get('btn3');
        btn3.on('click', Delegate.create(this, function() {
            ExtClass.fly('p3text').update('Working');
            btn3.dom.disabled = true;
            pbar3.wait({ interval: 200, duration: 5000, increment: 15, fn: Delegate.create(this, function() {
                btn3.dom.disabled = false;
                ExtClass.fly('p3text').update('Done');
            }) });
        }));
        var pbar4 = new Ext.ProgressBar(new Ext.ProgressBarConfig().custom('text', 'Waiting on you...').id('pbar4').custom('textEl', 'p4text').cls('custom').renderTo('p4').toDictionary());
        var btn4 = ExtClass.get('btn4');
        btn4.on('click', Delegate.create(this, function() {
            SampleScripts.simple_widgets._runner.run(pbar4, btn4, 19, Delegate.create(this, function() {
                pbar4.updateText('All finished!');
            }));
        }));
    }
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.simple_widgets._runner

SampleScripts.simple_widgets._runner = function SampleScripts_simple_widgets__runner() {
}
SampleScripts.simple_widgets._runner._f = function SampleScripts_simple_widgets__runner$_f(v, pbar, btn, count, onComplete) {
    return Delegate.create(null, function() {
        if (v > count) {
            btn.dom.disabled = false;
            onComplete.invoke();
        }
        else {
            var i = v / count;
            if (pbar.id === 'pbar4') {
                pbar.updateProgress(i, Math.round(100 * i) + '% completed...');
            }
            else {
                pbar.updateProgress(i, String.format('Loading item {0} of {1}...', v, count));
            }
        }
    });
}
SampleScripts.simple_widgets._runner.run = function SampleScripts_simple_widgets__runner$run(pbar, btn, count, onComplete) {
    btn.dom.disabled = true;
    var ms = 5000 / count;
    for (var i = 1; i < (count + 2); i++) {
        window.setTimeout(SampleScripts.simple_widgets._runner._f(i, pbar, btn, count, onComplete), i * ms);
    }
}


Type.createNamespace('SampleScripts.tabs');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.tabs.TabScript

SampleScripts.tabs.TabScript = function SampleScripts_tabs_TabScript() {
}
SampleScripts.tabs.TabScript.main = function SampleScripts_tabs_TabScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.tabs.TabScript().init();
    }));
}
SampleScripts.tabs.TabScript._handleActivate = function SampleScripts_tabs_TabScript$_handleActivate(tab) {
    Ext.MessageBox.alert('Alert', tab.title + ' was activated.');
}
SampleScripts.tabs.TabScript.prototype = {
    
    init: function SampleScripts_tabs_TabScript$init() {
        new Ext.TabPanel(new Ext.TabPanelConfig().renderTo('tabs1').width(450).custom('activeTab', 0).frame(true).defaults({ autoHeight: true }).items([ { contentEl: 'script', title: 'Short Text' }, { contentEl: 'markup', title: 'Long Text' } ]).toDictionary());
        new Ext.TabPanel(new Ext.TabPanelConfig().renderTo(document.body).custom('activeTab', 0).width(600).height(250).custom('plain', true).defaults({ autoScroll: true }).items([ { title: 'Normal Tab', html: 'My content was added during construction.' }, { title: 'Ajax Tab 1', autoLoad: 'ajax1.htm' }, { title: 'Ajax Tab 2', autoLoad: { url: 'ajax2.aspx', params: 'foo=bar&wtf=1' } }, { title: 'Event Tab', listeners: { activate: Delegate.create(null, SampleScripts.tabs.TabScript._handleActivate) }, html: 'I am tab4\'s content. I also have an event listener attached.' }, { title: 'Disabled Tax', disabled: true, html: 'Can\'t see me cause I\'m disabled' } ]).toDictionary());
    }
}


Type.createNamespace('SampleScripts.view');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.view.Photo

SampleScripts.view.Photo = function SampleScripts_view_Photo() {
}
SampleScripts.view.Photo.prototype = {
    name: null,
    size: null,
    shortName: null,
    sizeString: null,
    dateString: null,
    lastmod: null
}


////////////////////////////////////////////////////////////////////////////////
// SampleScripts.view.DataViewScript

SampleScripts.view.DataViewScript = function SampleScripts_view_DataViewScript() {
}
SampleScripts.view.DataViewScript.main = function SampleScripts_view_DataViewScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.view.DataViewScript().init();
    }));
}
SampleScripts.view.DataViewScript.prototype = {
    
    init: function SampleScripts_view_DataViewScript$init() {
        var store = new Ext.data.JsonStore(new Ext.data.JsonStoreConfig().url('get-images.ashx/Get').custom('root', 'images').fields([ { name: 'url' }, { name: 'size', type: 'float' }, { name: 'lastmod', type: 'date', dateFormat: 'timestamp' } ]).toDictionary());
        store.load();
        var tpl = new Ext.XTemplate('<tpl for=\".\">\r\n\t\t\t\t\t<div class=\"thumb-wrap\" id=\"{name}\">\r\n\t\t\t\t\t<div class=\"thumb\"><img src=\"{url}\" title=\"{name}\"></div>\r\n\t\t\t\t\t<span class=\"x-editable\">{shortName}</span></div>\r\n\t\t\t\t</tpl>\r\n\t\t\t\t<div class=\"x-clear\"></div>');
        var panel = new Ext.Panel(new Ext.PanelConfig().id('images-view').frame(true).width(535).autoHeight(true).collapsible(true).layout('fit').title('Simple DataView with editable labels, multi and drag selection').items(new Ext.DataView(new Ext.DataViewConfig().store(store).tpl(tpl).autoHeight(true).multiSelect(true).overClass('x-view-over').itemSelector('div.thumb-wrap').emptyText('No images to display').custom('prepareData', Delegate.create(this, function(data) {
            data.shortName = Ext.util.Format.ellipsis(data.name, 15);
            data.sizeString = Ext.util.Format.fileSize(data.size);
            data.dateString = data.lastmod.toString();
            return data;
        })).toDictionary())).toDictionary());
        panel.render(document.body);
    }
}


Type.createNamespace('SampleScripts.window');

////////////////////////////////////////////////////////////////////////////////
// SampleScripts.window.HelloScript

SampleScripts.window.HelloScript = function SampleScripts_window_HelloScript() {
}
SampleScripts.window.HelloScript.main = function SampleScripts_window_HelloScript$main(args) {
    ExtClass.onReady(Delegate.create(null, function() {
        new SampleScripts.window.HelloScript().init();
    }));
}
SampleScripts.window.HelloScript.prototype = {
    _win: null,
    
    init: function SampleScripts_window_HelloScript$init() {
        var button = ExtClass.get('show-btn');
        button.on('click', Delegate.create(this, this._showWindow));
    },
    
    _showWindow: function SampleScripts_window_HelloScript$_showWindow(evt, el) {
        if (!this._win) {
            this._win = new Ext.WindowClass(new Ext.WindowConfig().custom('el', 'hello-win').layout('fit').width(500).height(300).closeAction('hide').plain(true).items(new Ext.TabPanel(new Ext.TabPanelConfig().custom('el', 'hello-tabs').custom('autoTabs', true).custom('activeTab', 0).custom('deferredRender', false).border(false).toDictionary())).buttons([ new Ext.ButtonConfig().text('Submit').disabled(true).toDictionary(), new Ext.ButtonConfig().text('Close').handler(Delegate.create(this, function() {
                this._win.hide();
            })).toDictionary() ]).toDictionary());
        }
        this._win.show(el);
    }
}


SampleScripts.core.TemplateScript.createClass('SampleScripts.core.TemplateScript');
SampleScripts.menu.State.createClass('SampleScripts.menu.State');
SampleScripts.menu.ComboScript.createClass('SampleScripts.menu.ComboScript');
SampleScripts.menu.CustomScript.createClass('SampleScripts.menu.CustomScript');
SampleScripts.menu.ActionsScript.createClass('SampleScripts.menu.ActionsScript');
SampleScripts.grid.ArrayGridScript.createClass('SampleScripts.grid.ArrayGridScript');
SampleScripts.grid.EditGridScript.createClass('SampleScripts.grid.EditGridScript');
SampleScripts.grid.CheckColumn.createClass('SampleScripts.grid.CheckColumn');
SampleScripts.grid.GroupingGridScript.createClass('SampleScripts.grid.GroupingGridScript');
SampleScripts.grid.PagingGridScript.createClass('SampleScripts.grid.PagingGridScript');
SampleScripts.grid.TotalsGridScript.createClass('SampleScripts.grid.TotalsGridScript');
SampleScripts.grid.XmlGridScript.createClass('SampleScripts.grid.XmlGridScript');
SampleScripts.messagebox.MessageBoxScript.createClass('SampleScripts.messagebox.MessageBoxScript');
SampleScripts.panel.PanelScript.createClass('SampleScripts.panel.PanelScript');
SampleScripts.SamplePanel.createClass('SampleScripts.SamplePanel', Ext.Panel);
SampleScripts.DefaultScript.createClass('SampleScripts.DefaultScript');
SampleScripts.resizable.BasicScript.createClass('SampleScripts.resizable.BasicScript');
SampleScripts.simple_widgets.ProgressBarScript.createClass('SampleScripts.simple_widgets.ProgressBarScript');
SampleScripts.simple_widgets._runner.createClass('SampleScripts.simple_widgets._runner');
SampleScripts.tabs.TabScript.createClass('SampleScripts.tabs.TabScript');
SampleScripts.view.Photo.createClass('SampleScripts.view.Photo');
SampleScripts.view.DataViewScript.createClass('SampleScripts.view.DataViewScript');
SampleScripts.window.HelloScript.createClass('SampleScripts.window.HelloScript');
SampleScripts.panel.PanelScript._html = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \r\n\t\t\tSed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. \r\n\t\t\tMaecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. \r\n\t\t\tVestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, \r\n\t\t\tsit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. \r\n\t\t\tSuspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.\r\n\t\t\t<br />\r\n\t\t\tAliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. \r\n\t\t\tAenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. \r\n\t\t\tMorbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. \r\n\t\t\tVivamus tincidunt diam nec urna. Curabitur velit.';
SampleScripts.SamplePanel.tpl = new Ext.XTemplate('<dl>' + '<tpl for=\"samples\">' + '<dt><a href=\"{url}\" target=\"_blank\"><img src=\"shared/screens/{icon}\"/></a><br/>' + '<span>{text}</span>' + '</dt>' + '</tpl>' + '</dl><div style=\"clear:both\"></div>');

// ---- Do not remove this footer ----
// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
// -----------------------------------
